package com.artPreter.controller;


import com.artPreter.pojo.ArtistSectionTemp;
import com.artPreter.pojo.Result;
import com.artPreter.service.IArtistSectionTempService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 艺术家栏目表 前端控制器
 * </p>
 *
 * @author jarvis
 * @since 2024-11-23
 */
@RestController
@RequestMapping("/artistSectionTemp")
public class ArtistSectionTempController {

    @Autowired
    private IArtistSectionTempService artistSectionTempService;

    /**
     * 添加艺术家栏目
     * @param
     * @return
     */
    @PostMapping("/add")
    public Result add(@RequestBody ArtistSectionTemp artistSectionTemp) {
        artistSectionTempService.add(artistSectionTemp);
        return Result.success();
    }

    /**
     * 删除艺术家栏目
     * @param
     * @return
     */
    @PostMapping("/delete")
    public Result delete(@RequestBody ArtistSectionTemp artistSectionTemp) {
        artistSectionTempService.delete(artistSectionTemp);
        return Result.success();
    }

    /**
     * 批量艺术家保存栏目
     * @param
     * @return
     */
    @PostMapping("/saveBatch")
    public Result saveBatchData(@RequestBody List<ArtistSectionTemp> artistSectionTempList) {
        artistSectionTempService.saveBatchData(artistSectionTempList);
        return Result.success();
    }

    /**
     * 获取艺术家栏目列表
     * @param
     * @return
     */
    @PostMapping("/getList")
    public Result getList(@RequestBody ArtistSectionTemp artistSectionTemp) {
        List<ArtistSectionTemp> list = artistSectionTempService.getList(artistSectionTemp);
        return Result.success(list);
    }

}
